var ClubMainItem = Item.extend({
    _ccsFileName: res.ClubMainItem_json,
    _clubInfo: null,
    onEnter: function () {
        Item.prototype.onEnter.call(this);
        this._addClickListeners();
    },


    _initClickListeners: function () {
        this._clickListeners = {
            'btnIntoClub': '_cliclBtnIntoClub',
        }
    },

    refreshData: function (clubInfo,idx) {
        this.setVisible(!(clubInfo == 0));
        if (clubInfo == 0) {
            return;
        }
        this._clubInfo = clubInfo;
        this._nodeList['lb_name'].setString(ellipsisStr(clubInfo.name, 10));
        this._nodeList['lb_qz'].setString(ellipsisStr(clubInfo.nick, ClubDataManager.NirckNameSize));
        this._nodeList['lb_id'].setString(clubInfo.id);
        this._nodeList['lb_players'].setString(clubInfo.players_count || '');
        this._nodeList['tableNum'].setString(clubInfo.room_cnt || '0');
        var index = idx % 2 == 0 ? 1:2;
        this._nodeList['club_bg'].setTexture(club.res['clublistBG'+index]);

        loadImageToSprite(clubInfo.head, this._nodeList['head'], true);
    },

    _cliclBtnIntoClub: function () {
        // var ctlayer = new ClubTablesLayer_New(this._clubInfo.id);
        // ctlayer.setName('ctlayer');
        // this.addChild(ctlayer);

        // clubMsgManager.requestListClubRoom(this._clubInfo.id, 0, 100, undefined, true);

        ClubViewUtil.openClubTableWindow(this._clubInfo.id);
        // showWindow('ClubTableWindow', this._clubInfo.id);
        eventManager.dispatchEvent(ClubEvent.ClubMainWindowClose);
        //存储当前选择的亲友圈Id  用于下次点开亲友圈时  上次选中的亲友圈放在第一位
        cc.sys.localStorage.setItem(ClubLastInfo, this._clubInfo.id);
    },


});